import java.util.Scanner;

public class Main3 {
    public static void main(String[] args) {
        //3、定义一个接口Aaa,其包含一个方法find();其下有三个类A1，A2，A3，
        //A1:查找三个整型数的最大数
        //A2：查找三个实型数的最小数
        //A3：查找一行字符中的单词数
        //定义一个主类H，通过输入对应的数据将三个类实例化，并实现对应的功能。
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        Aaa aaa = new A1(a,b,c);

        double a1 = scanner.nextDouble();
        double b1 = scanner.nextDouble();
        double c1 = scanner.nextDouble();
        Aaa aaa1 = new A2(a1,b1,c1 );

        String s = scanner.nextLine();
        Aaa aaa2 = new A3(s);

        Aaa[] aaas = {aaa,aaa1,aaa2};

        for(Aaa aa : aaas){
            aa.find();
        }

    }
}

interface Aaa{
    void find();
}

class A1 implements Aaa{
    int a,b,c;

    public A1() {
    }

    public A1(int a, int b, int c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public void find() {
        System.out.println("最大数是:" + Math.max(Math.max(this.a,this.b),Math.max(this.b,this.c)));
    }
}

class A2 implements Aaa{
    double a,b,c;

    public A2() {
    }

    public A2(double a, double b, double c) {
        this.a = a;
        this.b = b;
        this.c = c;
    }

    @Override
    public void find() {
        System.out.println("最小数是:" + Math.min(Math.min(this.a,this.b),Math.min(this.b,this.c)));
    }
}

class A3 implements Aaa{
    String s;

    public A3() {
    }

    public A3(String s) {
        this.s = s;
    }

    @Override
    public void find() {
        int res = 0;
        for (int i = 0; i < this.s.length(); i++) {
            if (s.charAt(i) == ' '){
                res++;
            }
        }
        System.out.println("字符串中有" + (res+1) + "个单词" );
    }
}